import React, {Component} from 'react'
import Taro from '@tarojs/taro'

import {View} from '@tarojs/components'
import './index.scss'

type PageStateProps = {
  List: []
}

type PageDispatchProps = {}

type PageOwnProps = {}

type PageState = {
}

type IProps = PageStateProps & PageDispatchProps & PageOwnProps

interface MyPicker {
  props: IProps;
}

class MyPicker extends Component<IProps, PageState> {
  constructor(props: IProps) {
    super(props)
    this.state = {
    }
  }

  componentDidMount() {
  }


  handleNavigateTo = (link:string) => {
    Taro.navigateTo({
      url: `/pages/article/index?link=${link}`
    })
  }

  render() {
    const {List} = this.props
    return (
      <View className='notice_list'>
        {
          List.map((item:any)=>
            <View className='notice_list_item' key={item.id} onClick={this.handleNavigateTo.bind(this,item.link)}>
              <View className='notice_list_item_title'>{item.content}</View>
              <View className='notice_list_item_remake'>点击查看详情...</View>
              <View className='notice_list_item_time'>--</View>
            </View>
          )
        }
      </View>

    )
  }
}


export default MyPicker
